/*****************************************************************************
 *   rtc.h:  Header file for NXP LPC23xx/24xx Family Microprocessors
 *
 *   Copyright(C) 2006, NXP Semiconductor
 *   All rights reserved.
 *
 *   History
 *   2006.07.13  ver 1.00    Prelimnary version, first Release
 *
******************************************************************************/
#ifndef __PORTLCD_H
#define __PORTLCD_H


/* Please note, on old MCB2300 board, the LCD_E bit is p1.30, on the new board
it's p1.31, please check the schematic carefully, and change LCD_CTRL and LCD_E
accordingly if you have a different board. */
/*
 * LCD IO definitions
 * - using P1.24 -> P1.31
 * -> Byte number = 3
 * */
#define LCD_E     (0x80)            /* Enable control pin                */
#define LCD_RW    (0x20)            /* Read/Write control pin            */
#define LCD_RS    (0x10)            /* Data/Instruction control          */
#define LCD_CTRL  (0xB0)            /* Control lines mask                */
#define LCD_DATA  (0x0F)            /* Data lines mask                   */

extern void LCD_init(void);
extern void LCD_load(uint8_t *fp, uint32_t cnt);
extern void LCD_gotoxy(uint32_t x, uint32_t y);
extern void LCD_cls(void);
extern void LCD_cur_off(void);
extern void LCD_on(void);
extern void LCD_putc(uint8_t c);
extern void LCD_puts(uint8_t *sp);
extern void LCD_bargraph(uint32_t val, uint32_t size);

/* Local Function Prototypes */
extern void delay( uint32_t cnt );
extern void lcd_write( uint32_t c );
extern void lcd_write_4bit( uint32_t c );
extern uint32_t lcd_read_stat( void );
extern void lcd_write_cmd( uint32_t c );
extern void lcd_write_data( uint32_t d );
extern void lcd_wait_busy( void );

#endif /* end __PORTLCD_H */
/*****************************************************************************
**                            End Of File
******************************************************************************/
